//package com.sc.nft.controller;
//
//import com.sc.nft.annotation.UserLogin;
//import com.sc.nft.annotation.WithoutSign;
//import com.sc.nft.exception.GlobalException;
//import com.sc.nft.pool.UserPool;
//import com.sc.nft.req.auth.WxCodeReq;
//import com.sc.nft.service.WxMiniUserService;
//import com.sc.nft.sup.Result;
//import com.sc.nft.vo.auth.GetUserOpenIdVO;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.http.MediaType;
//import org.springframework.web.bind.annotation.*;
//
//import javax.validation.Valid;
//
//@Slf4j
//@RequiredArgsConstructor
//@RestController
//@RequestMapping("/ipMall/wxMiniMall/user/auth")
//@Api(tags = "微信小程序登录")
//public class WxMiniLogInController{
//
//
//    private final WxMiniUserService wxMiniUserService;
//
//
//
////    @PostMapping(value = "/getOpenId", produces = MediaType.APPLICATION_JSON_VALUE)
////    @ApiOperation(value = "获取用户openid")
////    public Result<GetUserOpenIdVO> getOpenId(@Valid @RequestBody WxCodeReq request) {
////        return wxMiniLogInClient.getOpenId(request);
////    }
//
//    @PostMapping(value = "/login", produces = MediaType.APPLICATION_JSON_VALUE)
//    @ApiOperation(value = "授权登录")
//    public Result<GetUserOpenIdVO> login(@Valid @RequestBody WxCodeReq request) throws GlobalException {
//        return Result.success(wxMiniUserService.login(request));
//    }
//
//    @PostMapping(value = "/register", produces = MediaType.APPLICATION_JSON_VALUE)
//    @ApiOperation(value = "授权手机号注册")
//    public Result register(@Valid @RequestBody WxCodeReq request) throws GlobalException {
//        return Result.success(wxMiniUserService.register(request));
//    }
//
//    @PostMapping(value = "/logout", produces = MediaType.APPLICATION_JSON_VALUE)
//    @ApiOperation(value = "退出登录")
//    @UserLogin
//    public Result<GetUserOpenIdVO> login() {
//        WxMiniUserInfo wxMiniUser = UserPool.getWxMiniUser();
//        wxMiniUserService.miniUserLogOut(wxMiniUser);
//        return Result.success();
//    }
//
//    @GetMapping(value = "/getAccessToken", produces = MediaType.APPLICATION_JSON_VALUE)
//    @ApiOperation(value = "获取小程序accessToken")
//    @WithoutSign
//    public String getAccessToken() {
//        return wxMiniUserService.getAccessToken();
//    }
//
//
//}